/**
 * Copyright &copy; 2012-2016 <a href="https://istep.lczyfz.com">Istep</a> All rights reserved.
 */
package com.lczyfz.istep.modules.scene.dao;

import com.lczyfz.istep.common.persistence.CrudDao;
import com.lczyfz.istep.common.persistence.annotation.MyBatisDao;
import com.lczyfz.istep.modules.scene.entity.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 路由管理DAO接口
 * @author dh
 * @version 2017-03-20
 */
@MyBatisDao
public interface SceneRouterDao extends CrudDao<SceneRouter> {
    List<SceneRouter> getRouterByName(SceneRouter sceneRouter);
    List<SceneSubnet>  getSubnetList(SceneRouter sceneRouter);
    void saveInterface(String routerId,String subnetId);
    void deleteInterface(String subnetId, String routerId);
    void deleteRouterTable(@Param("routerId")String routerId);
    void deleteRouterFirewall(@Param("routerId")String routerId);
    void deleteFirewall(@Param("firewallId")String firewallId);
    void deleteFirewallRule(@Param("firewallId")String firewallId);
    void deleteRouterPort(@Param("routerId")String routerId);

    void removeGateWay(SceneRouter sceneRouter);
    List<SceneRouter> findRouterListByEnvironmentId(@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL,@Param("id")String id);
    List<SceneRouterTable> findRouterTableListByRouterId(@Param("routerId")String routerId);
    List<SceneFirewall> findFirewallListByEnvironmentId(@Param("environmentId")String environmentId);

    void routerPortSave(@Param("routerId")String routerId,@Param("portId")String portId,@Param("ip")String ip);

    void routerTableSave(SceneRouterTable sceneRouterTable);
    SceneFirewall getRouterFirewall(@Param("routerId")String routerId);
    void firewallInsert(SceneFirewall sceneFirewall);
    void routerFirewallInsert(@Param("firewallId")String firewallId,@Param("routerId")String routerId);
    List<SceneFirewallRule> findFirewallRuleList(@Param("firewallId")String firewallId);
    void firewallRuleInsert(SceneFirewallRule sceneFirewallRule);


    List<SceneRouter> findCtfRouterListByEnvironmentId(SceneCtfEnvironment sceneCtfEnvironment);
    SceneFirewall getFirewallById(@Param("firewallId")String firewallId);

}